﻿import QtQuick 2.15

Item {
    id: userInfoRect

    property string number: ""
    property string name: ""
    property string ip: ""
    property string port: ""

    width: parent.width*0.4
    height: parent.height/6
    visible: false
    z: 11
    Rectangle{
        id: rectangle
        anchors.fill: parent
        color: "#6cb2d9"
        radius: 5

        Text {
            id: nameText
            color: "#ffffff"
            text: name?"用户名："+name:"UserName"
            anchors.left: parent.left
            anchors.top: parent.top
            horizontalAlignment: Text.AlignLeft
            verticalAlignment: Text.AlignVCenter
            anchors.leftMargin: 5
            anchors.topMargin: 5
        }
        Text {
            id: numberText
            color: "#ffffff"
            text: number?"账号："+number:"UserAccount"
            anchors.left: parent.left
            anchors.top: nameText.bottom
            horizontalAlignment: Text.AlignLeft
            verticalAlignment: Text.AlignVCenter
            anchors.leftMargin: 5
            anchors.topMargin: 5
        }
        Text {
            id: ipText
            color: "#ffffff"
            text: ip?"地址："+ip:"UserIP"
            anchors.left: parent.left
            anchors.top: numberText.bottom
            horizontalAlignment: Text.AlignLeft
            verticalAlignment: Text.AlignVCenter
            anchors.leftMargin: 5
            anchors.topMargin: 5
        }
        Text {
            id: portText
            color: "#ffffff"
            text: port?"端口："+port:"UserAccount"
            anchors.left: parent.left
            anchors.top: ipText.bottom
            horizontalAlignment: Text.AlignLeft
            verticalAlignment: Text.AlignVCenter
            anchors.leftMargin: 5
            anchors.topMargin: 5
        }
    }

}
